<template>
  <router-view v-if="isRouterAlive"/>
</template>

<script>
import { ref, provide, nextTick } from 'vue';
export default {
    name:"App",
    setup(){
      // 页面刷新的方法
        const isRouterAlive = ref(true);
        const reload = () => {
            isRouterAlive.value = false;
            nextTick(()=>{
                isRouterAlive.value = true;
            })
            console.log('111')
        }
        provide('reload',reload);
        return{
          isRouterAlive,
          reload
        }
    },
    components:{
    }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
}
</style>
